[MTR04] W2 D12 練習三


Posted by Christy on 2020-07-16

練習三:寫一個能夠印出 n 個 的函式
寫一個函式 star,接收一個參數 n,並印出 n 個

(禁止使用內建函式 repeat)

star(1) 預期輸出:
*

star(5) 預期輸出:


star(10) 預期輸出:


function star(n){
 for (i = 1; i<=n; i++) {
}
console.log(star(1))

中間少了星星,應該有要擺的地方,明天繼續研究。










Related Posts

[day 04] Class & constructor: 吃語法糖別噎到

[day 04] Class & constructor: 吃語法糖別噎到

Props  觀念與使用

Props 觀念與使用

[ JavaScript 11 ] 無敵重要的 Immutable 觀念

[ JavaScript 11 ] 無敵重要的 Immutable 觀念


Comments